#include "progbar.h"

void download(void (*pf)(double))
{
    double total = TOTAL;
    double alreadly = 0.0;
    double rate;
    srand((unsigned int)time(NULL)^1023);
    while(alreadly < total)
    {
        alreadly += rand()%(1024*1024);
        if(alreadly > total)
            alreadly = total;
        rate = alreadly/total*100.0;
        pf(rate);
    }
}

int main()
{
    download(progress);
    return 0;
}
